00001 // Emacs Mode Line: -*- Mode:c++;-*- 00002 // ------------------------------------------------------------- 00003 /* 00004 * Copyright (c) 2013 Battelle Memorial Institute 00005 * Licensed under modified BSD License. A copy of this license can be found 00006 * in the LICENSE file in the top level directory of this distribution. 00007 */ 00008 // ------------------------------------------------------------- 00009 // ------------------------------------------------------------- 00010 /** 00011 * @file julia_optimizer_implementation.hpp 00012 * @author William A. Perkins 00013 * @date 2016-12-08 14:56:41 d3g096 00014 * 00015 * @brief 00016 * 00017 * 00018 */ 00019 // ------------------------------------------------------------- 00020 // ------------------------------------------------------------- 00021 // Created December 7, 2016 by William A. Perkins 00022 // Last Change: 2013-05-03 12:23:12 d3g096 00023 // ------------------------------------------------------------- 00024 00025 00026 #ifndef _julia_optimizer_implementation_hpp_ 00027 #define _julia_optimizer_implementation_hpp_ 00028 00029 #include "file_optimizer_implementation.hpp" 00030 00031 namespace gridpack { 00032 namespace optimization { 00033 00034 // ------------------------------------------------------------- 00035 // class JuliaOptimizerImplementation 00036 // ------------------------------------------------------------- 00037 /// Base class for optimizers that take the Julia language as input 00038 class JuliaOptimizerImplementation 00039 : public FileOptimizerImplementation 00040 { 00041 public: 00042 00043 /// Default constructor. 00044 JuliaOptimizerImplementation(const parallel::Communicator& comm); 00045 00046 /// Destructor 00047 ~JuliaOptimizerImplementation(void); 00048 00049 protected: 00050 00051 /// Some extra stuff to put at the beginning of the Julia script 00052 std::string p_preamble; 00053 00054 /// Specialized way to configure from property tree 00055 void p_configure(utility::Configuration::CursorPtr props); 00056 00057 /// Specialized way to set file name 00058 void p_setFilename(std::string file); 00059 00060 /// Write an Julia file to the specified stream 00061 void p_write(const p_optimizeMethod& m, std::ostream& out); 00062 00063 }; 00064 00065 00066 00067 } // namespace optimization 00068 } // namespace gridpack 00069 00070 #endif